home *** CD-ROM | disk | FTP | other *** search
- /* cminor.h - enhancements to C syntax */
-
- /* define file opening modes for gfopen, gopen, gcreat */
- #define BIN_MODE 0
- #define ASC_MODE 1
-
- /* use the following when the compiler treats char as signed */
- #define tochar(c) ( (c) & 0xff )
-
- /* use the following when char is treated as unsigned */
- /* #define tochar(c) c */
-
- /* toascii - strip parity bit from a char value */
- #define toascii(c) ( (c) & 0x7f )
-
- /* test a char to see whether the high-order bit is zero */
- #define isascii(c) ( ((c) & 0x80) == 0 )
-
- /* test a char to see if it is a printable (ASCII graphic) */
- #define isgraphig(c) ( ((c) >= ' ') && ((c) <= '~') )
-
- /* English for equality comparison operator */
- #define is ==
-
- /* English for logical operators */
- #define and &&
- #define or ||
-
- /* portable dara types */
- typedef int int16 ; /* signed 16 bit integer */
- typedef int INT16 ; /* signed 16 bit integer */
- typedef long int32 ; /* signed 32 bit integer */
- typedef long INT32 ; /* signed 32 bit integer */
- typedef unsigned word16 ; /* unsigned 16 bit number*/
- typedef unsigned WORD16 ; /* unsigned 16 bit number*/
-
- /* maximum, minimum and absolute macros */
- #define max(a,b) ( (a) < (b) ? (b) : (a) )
- #define min(a,b) ( (a) < (b) ? (a) : (b) )
- #define abs(x) ( (x) < 0 ? -(x) : (x) )
-
- /* END */
-